The controlGroupStyle
property allows you to set the visual and interactive style for control groups within your view, reflecting the look and feel found in SwiftUI. By defining a ControlGroupStyle
, you can influence how related controls—such as buttons, toggles, or other interactable elements—are grouped and presented to the user.
In SwiftUI, you might set a controlGroupStyle
like this:
In Scripting (TypeScript/TSX), you can achieve similar styling by using the controlGroupStyle
property on a view that contains control group components:
You can assign any of the following string values to controlGroupStyle
to define how the control group is displayed:
automatic
: Let the system decide an appropriate style based on the context.compactMenu
: Presents the controls as a compact menu when tapped, or as a submenu if nested within a larger menu.menu
: Displays the controls in a menu format when pressed, or as a submenu when nested.navigation
: Styles the controls to fit within a navigation context, often aligning with platform-specific navigation styles.palette
: Presents the controls in a palette-like grouping, often showing multiple actions at once.controlGroupStyle
to a MenuIn this example, the controls will appear as a menu. Tapping or interacting with the group will present the items in a menu-like interface.
Here, the controls may be displayed together in a palette, which could show multiple styling options together for quick selection.
If you’re unsure which style is best, or want to let the system pick a suitable style, you can choose automatic
:
By setting controlGroupStyle
, you guide how your set of controls are displayed and interacted with. Whether you choose a menu
, compactMenu
, navigation
, palette
, or rely on automatic
, this property helps ensure that your script’s controls feel naturally integrated with the platform’s UI conventions and user expectations.